ass MyQueue {
public:
    MyQueue() 
    {

    }
    
    void push(int x) 
    {
        inst.push(x);
    }
    
    int pop() 
    {
        // 不为空的时候全部放到out里面去
        if (outst.empty())
        {
        while(!inst.empty())
        {
            outst.push(inst.top());
            inst.pop();
        }
        }

        // 从出栈删除
        int top = outst.top();
        outst.pop();

        return top;
    }
    
    int peek() 
    {
        // 不为空的时候全部放到out里面去
        if (outst.empty())
        {
        while(!inst.empty())
        {
            outst.push(inst.top());
            inst.pop();
        }
        }

        return outst.top();
    }
    
    bool empty() 
    {
        return inst.empty() && outst.empty();
    }

private:
    stack<int> inst;
    stack<int> outst;
};

/**
 * Your MyQueue object will be instantiated and called as such:
 * MyQueue* obj = new MyQueue();
 * obj->push(x);
 * int param_2 = obj->pop();
 * int param_3 = obj->peek();
 * bool param_4 = obj->empty();
 */
